#include "Comm.hpp"

class Client
{
public:
    Client() : _fd(defaultfd)
    {
        _fd = OpenPipeWrite();//不能先打开写端，因为需要读端进行创建命名管道 fifo
        if(_fd<0) exit(0);
    }


    //写端
    ssize_t WritePipe(const std::string &message)
    {
        return ::write(_fd, message.c_str(), message.size());
    }

    ~Client()
    {
        ClosePipe();
    }

private:
    int _fd;
};